<?php
	require_once 'header.php';
	require_once 'navigation.php';
	$smarty->display('user_left.html');
	
	//Get Current ColumnID
	if (isset($_SESSION['unc']) && $_SESSION['unc'] != '') {
		$smarty->assign('isLogin', 'T');
		
		$usernc = $_SESSION['unc'];
		$user = $adminDB->executeSQL("select u.id, u.fdLogin, u.fdName, u.fdCompany, u.fdPosition, e.fdEmail, t.fdPhone as fdTelePhone, m.fdPhone as fdMobilePhone, a.fdAddress, a.fdPostcode from ".$util->userdbName().".tbUser u left outer join ".$util->userdbName().".tbEmail e on e.fdUserID=u.id and e.fdDefault=0 left outer join ".$util->userdbName().".tbPhone t on t.fdUserID=u.id and t.fdTypeID=0 left outer join ".$util->userdbName().".tbPhone m on m.fdUserID=u.id and m.fdTypeID=1 left outer join ".$util->userdbName().".tbAddress a on a.fdUserID=u.id and a.fdDefault=0 where u.fdLogin='".$usernc."'", $connID);
		
		$smarty->assign('user', $user);
		
	} else {
		$smarty->assign('isLogin', 'F');
		if (isset($_SESSION['toUrl'])) {
			unset($_SESSION['toUrl']);
		}
		$_SESSION['toUrl'] = 'usermanage.php';
		
		echo "<script>alert('请先登录！');window.location.href='login.php';</script>";	
	}
	
	
	$smarty->display('user_manage.html');
	require_once 'contact.php';
	require_once 'footer.php';
?>